import request from '@/utils/request'

// 申请列表
export function resourcesUpList(data) {
  return request({
    url: '/activiti/ResourcesUp/list',
    method: 'get',
    params: data
  })
}
// 详情
export function resourcesUpDetail(id) {
  return request({
    url: '/activiti/ResourcesUp/'+id,
    method: 'get',
  })
}
//根据流程实例id获取资源申请详细信息
export function instId(data) {
  return request({
    url: '/activiti/ResourcesUp/instId/'+data.id,
    method: 'get',
    params: data
  })
}
// 提交申请
export function apply(data) {
  return request({
    url: '/activiti/ResourcesUp/apply',
    method: 'post',
    data: data
  })
}



// 审核资源申请
export function audit(data) {
  return request({
    url: '/activiti/ResourcesUp/audit/'+data.taskId,
    method: 'post',
    data: data
  })
}
// 审核资源申请
export function auditchange(data) {
  return request({
    url: '/activiti/ResourcesUpdate/audit/'+data.taskId,
    method: 'post',
    data: data
  })
}

//根据code查询下级规格列表
export function listByCode(code) {
  return request({
    url: '/spec/listByCode/'+code,
    method: 'get',
  })
}

//根据分类code查询服务列表
export function serviceByClazz(data) {
  return request({
    url: '/logic/serviceByClazz/'+data.supplier+'/'+data.code,
    method: 'get',
    params: data
  })
}
//根据分类code查询服务列表
export function classByCode(data) {
  return request({
    url: '/logic/classByCode/'+ data.code,
    method: 'get',
    params: data
  })
}
//根据分类code查询服务列表
export function XCspecEcs(data) {
  return request({
    url: '/spec/group/' +data.Inspur+'/xcecs',
    method: 'get',
  })
}
//根据分类code查询服务列表
export function specEcs(data) {
  return request({
    url: '/spec/group/' +data.Inspur+'/spec_ecs',
    method: 'get',
  })
}

// 查询审批历史
export function formResourceUp(id) {
  return request({
    url: '/listHistory/formResourceUp/' + id,
    method: 'get',
  })
}